• Watch

New API Entry Not Working #279

Closed
Kandelai opened this issue on Jan 7, 2020 · 18 comments

Comments

@Kandelai

Pick your reaction

Kandelai commented on Jan 7, 2020

Description

Apparently now you have to create a Google/Youtube API code and plug it into Headset. I went through the steps as directed to create a new API Code, entered it into Headset, but I keep getting Invalid Code Error. The Code on Google says active. I waited many hours and tried several times to enter the code, but same Invalid Error occurs.

Your Environment

I am using Manjaro OS (Arch-based), KDE, Stable Release.
Headset version in AUR reads 3.1.0-1

@fcastilloec

Pick your reaction

Member

fcastilloec commented on Jan 7, 2020

I've tested with multiple accounts and keys and they all work. Make sure you copy/paste the correct code. Also, make sure that you created an "API key" and not an "OAuth client ID" and you haven't added any restrictions.
It should look like this:
Selection_023

@Kandelai

Pick your reaction

Author

Kandelai commented on Jan 7, 2020

I actually typed it the API Key this time and still get 'Key is Invalid. Please try again.' I did create an 'API Key' and not an 'OAuth client ID'. No restrictions. I will attach a screenshot.

Screenshot_20200107_161845

@fcastilloec

Pick your reaction

Member

fcastilloec commented on Jan 7, 2020

It seems that the key has been used and working from the screenshot you posted.
I would recommend deleting your config directory and restart Headset. On Linux, this is under ~/.config/Headset. You will have to re-login afterward.
@danielravina is there a way to debug this from the user's side?

@Kandelai

Pick your reaction

Author

Kandelai commented on Jan 7, 2020

It is a new key. Every time I try and enter it in Headset, it registers as a "usage" which is why you are seeing on my google screenshot. I have already tried removing the app completely and deleted the Headset folder under the folder .config, then reinstalled it. Same error.

@danielravina

Pick your reaction

Copy link
Reference in new issue

Reference in new issue

headset-electron
Repositories
Member

danielravina commented on Jan 7, 2020 •

I was able to replicate your issue (I think)

  1. I restrict the key only to Youtube API
  2. I regenrated a new Key
  3. I clicked Save
  4. I waited about a minute
  5. copied the key from the same place you took the screen shot
  6. Worked

@Kandelai can you try that?
Screen_Shot_2020-01-07_at_5_19_18_PM

@Kandelai

Pick your reaction

Author

Kandelai commented on Jan 7, 2020 •

I did everything you described, thanks for the detailed instructions/screenshot. Unfortunately, it did not work. I will wait a little longer and keep trying, but no go so far.

@danielravina

Pick your reaction

Member

danielravina commented on Jan 7, 2020

I'm really sorry you are experiencing this. If you need, I can send you my working key via email. I don't mind at all

@Kandelai

Pick your reaction

Author

Kandelai commented on Jan 7, 2020 •

I appreciate the offer, but I will wait it out and try again down the road. It was an excellent app/service. It is unfortunate Google doesn't like to play nicely. ;-) I will check back and see if it irons itself out. Best to you.

@actionless

Pick your reaction

actionless commented on Jan 8, 2020 •

having the same problem

would be useful if your app would be writing the real error somewhere instead of 2020-01-08--1578481103_400x57_scrot
at least to stdout (if you afraid your typical user will got shocked from js stacktrace

in Google API dashboard i see what every request to youtube.search.list is failed:

2020-01-08--1578481037_3320x1846_scrot

@danielravina

Pick your reaction

Member

danielravina commented on Jan 8, 2020

@actionless I just added a button to show the full error message. can you copy it and paste it here please?

@actionless

Pick your reaction

actionless commented on Jan 8, 2020

2020-01-08--1578520501_1406x2038_scrot

@danielravina

Pick your reaction

Member

danielravina commented on Jan 8, 2020 •

@actionless Sorry - I pushed another version (2.8.6) that gives more details on the error. Can you please try again? Thank you

Also - it wouldn't expose your API key

@actionless

Pick your reaction

actionless commented on Jan 8, 2020

MY ERROR MESSAGE FIX:
https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=735553271244

finally i've got some error message in the webdev console ^^

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured. YouTube Data API has not been used in project XXXXXXXXXXXXXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=XXXXXXXXXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
    "extendedHelp": "https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=XXXXXXXXXXXXX"
   }
  ],
  "code": 403,
  "message": "Access Not Configured. YouTube Data API has not been used in project XXXXXXXXXXXXXXXX before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/youtube.googleapis.com/overview?project=XXXXXXXXXXXXX then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry."
 }
}
@actionless

Pick your reaction

actionless commented on Jan 8, 2020

So my solution to the problem was:
to create project again, for some reason adding key to existing project wasn't working

@fcastilloec

Pick your reaction

Member

fcastilloec commented on Jan 8, 2020 •

@actionless I was about to mention that. While searching online, it seems this was the only workaround that worked.
I did manage to create a key from an existing project that did work, but this existing project is only a couple of weeks old. I've heard that old projects might have issues with inactivity, but I have no real prove about that.
@danielravina maybe we should mention in the guide that a new project needs to be created, just to be safe?

@actionless

Pick your reaction

actionless commented on Jan 8, 2020 •

I've heard that old projects might have issues with inactivity, but I have no real prove about that.

yup, i've used a project from 2015

maybe we should mention in the guide that a new project needs to be created, just to be safe?

yes, or also mention not only what key not working first few minutes after creation, but also what too old project might not work

@Kandelai

Pick your reaction

Author

Kandelai commented on Jan 8, 2020

Confirmed this worked for me as well, created a new project (was using a previously created project) and API key with restrictions applied to the youtube API under it. Awesome...and thanks again.

@danielravina

Pick your reaction

Copy link
Reference in new issue

Reference in new issue

headset-electron
Repositories
Member

danielravina commented on Jan 8, 2020 •

Awesome! Glad it's working :) I updated the guide and added a link to this issue +1 Thanks so much!

Remember, contributions to this repository should follow its .
You can’t perform that action at this time.